﻿@using Windvoice.Blog
@using Windvoice.Library
@using Windvoice.Library.Mvc
@{
    ViewBag.Title = "";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="body-left">
    <div class="artical-list">
        @{TextWriterHelper.WriteLine("v1", DateTime.Now);}
        @foreach (var blog in (Article[])ViewBag.BlogList)
        {
            <div class="article-block blog-@(Enum.Parse(typeof(WindvoiceWeatherCondition), blog.Weather.ToString()).ToString().ToLower())">
                <div class="head">
                    <div class="date">
                        <div class="upper">@blog.CreateTime.ToString("yyyy-MM")</div>
                        <div class="lower">@blog.CreateTime.ToString("dd")</div>
                    </div>
                    <div class="title">
                        <h3>
                            <a href="/blog/@blog.UniqueKey">@blog.Title</a>
                        </h3>
                        <p>
                            by @blog.Author 
                            at @blog.CreateTime.ToString("HH:mm:ss") 
                            in <a href="/blogs/@Category.Find(blog.CategoryID).UniqueKey">@Category.Find(blog.CategoryID).Name</a>
                        </p>
                    </div>
                </div>
                <div class="content">
                    @Html.Raw(Windvoice.Library.HtmlHelper.HtmlSummary(blog.Content, 300))
                    <a href="/blog/@blog.UniqueKey">Continue reading..</a>
                </div>
                <div class="tail">
                    <div class="left">
                        Temperature:@blog.Hits℃ | 
                        Comments:@Comment.GetCommentCount(blog.ID)
                    </div>
                    <div class="right">
                        <iframe allowTransparency="true" class="weibo-share" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=@(Request.Url)&type=3&ralateUid=104312&title=@(Server.UrlEncode(blog.Title))&rnd=@(new Random().Next())&width=16&height=16"></iframe>
                    </div>
                </div>
            </div>
        }
        @{TextWriterHelper.WriteLine("v2", DateTime.Now);}
    </div>
    
    @Html.Pager((int)ViewBag.RecordCount, "manu", pageSize: (int)ViewBag.PageSize)
</div>
@Html.Partial("_PartialRight")
<div class="clear"></div>